import {defineConfig} from 'vite'
import {fileURLToPath, URL} from 'node:url'
import vue from '@vitejs/plugin-vue'
import UnoCSS from 'unocss/vite'

// https://vitejs.dev/config/
export default defineConfig({
  base: '/easy-design',
  plugins: [
    vue(),
    UnoCSS(),
  ],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
      'easy-design': fileURLToPath(new URL('../src', import.meta.url)),
    }
  },
  esbuild: {
    jsxFactory: 'h',
    jsxInject: `import {h} from '@/utils/jsx-runtime.ts'`,
  },
  server: {
    fs: {
      strict: false,
    }
  }
})
